package org.simplextensions.registry;

import javassist.bytecode.ClassFile;
import javassist.bytecode.annotation.Annotation;

import org.simplextensions.scanner.IClassScanner;

public class ScanPhaseListenerAdapter implements IClassScanner {

	private final IExtensionScanPhaseListener extensionScanPhaseListener;
	private final IExtensionRegistry registry;
	private final Bundle bundle;

	public ScanPhaseListenerAdapter(IExtensionRegistry registry, Bundle bundle,
			IExtensionScanPhaseListener extensionScanPhaseListener) {
		this.registry = registry;
		this.bundle = bundle;
		this.extensionScanPhaseListener = extensionScanPhaseListener;
	}

	public void scanClass(ClassFile classFile, Annotation a) {
		extensionScanPhaseListener.scanClass(registry, bundle, classFile
				.getName(), a);
	}

}